home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / spread.z / spread
Encoding:
Text File  |  1998-10-30  |  3.6 KB  |  93 lines

  1. SPREAD(3I)                                             Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      SSPPRREEAADD - Constructs an array from several copies of an actual argument
  6.  
  7. SSYYNNOOPPSSIISS
  8.      SSPPRREEAADD (([SSOOUURRCCEE==]_s_o_u_r_c_e,, [DDIIMM==]_d_i_m,, [NNCCOOPPIIEESS==]_n_c_o_p_i_e_s))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13. SSTTAANNDDAARRDDSS
  14.      Fortran 90
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The SSPPRREEAADD intrinsic function constructs an array from several copies
  18.      of an actual argument.  This intrinsic function can be used for array
  19.      construction.  It replicates an array by adding a dimension.  It
  20.      broadcasts several copies of _s_o_u_r_c_e along a specified dimension and
  21.      thus forms an array of rank one greater.  SSPPRREEAADD accepts the following
  22.      arguments:
  23.  
  24.      _s_o_u_r_c_e    May be of any type.  It may be scalar or array valued.  The
  25.                rank of _s_o_u_r_c_e must be less than 7.
  26.  
  27.      _d_i_m       Must be scalar and an integer with value in the range of
  28.                1 <= _d_i_m <= _n + 1, where _n is the rank of _s_o_u_r_c_e.  This
  29.                function does a check on _d_i_m.
  30.  
  31.      _n_c_o_p_i_e_s   Must be scalar and an integer.
  32.  
  33.      SSPPRREEAADD is a transformational intrinsic function.  The name of this
  34.      intrinsic cannot be passed as an argument.
  35.  
  36. RREETTUURRNN VVAALLUUEESS
  37.      The result is an array of the same type as _s_o_u_r_c_e and of rank _n+1,
  38.      where _n is the rank of _s_o_u_r_c_e.
  39.  
  40.      If _s_o_u_r_c_e is scalar, the shape of the result is MMAAXX((_n_c_o_p_i_e_s,,00)).  If
  41.      _s_o_u_r_c_e is array valued with shape
  42.      (_d , _d , ..., _d ),
  43.        1   2        _n
  44.      the shape of the result is
  45.      (_d , _d , ..., _d     , MMAAXX(_n_c_o_p_i_e_s, 0), _d   , ..., _d ).
  46.        1   2        _d_i_m-1                    _d_i_m        _n
  47.  
  48.      If _s_o_u_r_c_e is scalar, each element of the result has a value equal to
  49.      _s_o_u_r_c_e.
  50.  
  51.      If _s_o_u_r_c_e is array valued, the element of the result with subscripts
  52.      (_r , _r , ..., _r   )
  53.        1   2        _n+1
  54.      has the value
  55.      _s_o_u_r_c_e(_r , _r , ..., _r     , _r     , ..., _r   )).
  56.              1   2        _d_i_m-1   _d_i_m+1        _n+1
  57.  
  58. EEXXAAMMPPLLEESS
  59.      Example 1:  Assume that IISSCCAALLRR is the scalar value of 8.  The
  60.      following statements are then true:
  61.  
  62.      * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 00)) is a zero-sized
  63.        array.
  64.  
  65.      * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 22)) is [8, 8].
  66.  
  67.      Example 2:  Assume that AA is the array [2, 3, 4].  The following
  68.      statements are then true:
  69.  
  70.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 00 )) is a zero-sized
  71.        array.
  72.  
  73.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 33 )) is as follows:
  74.  
  75.         | 2 3 4 |
  76.  
  77.         | 2 3 4 |
  78.  
  79.         | 2 3 4 |
  80.  
  81.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 22,, NNCCOOPPIIEESS == 33 )) is as follows:
  82.  
  83.         | 2 2 2 |
  84.  
  85.         | 3 3 3 |
  86.  
  87.         | 4 4 4 |
  88.  
  89. SSEEEE AALLSSOO
  90.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  91.      printed version of this man page.
  92.  
  93.